//asdf
#ifndef PLAYER_H
#define PLAYER_H

#include "ai.h"
#include "world.h"
#include "weapon/weapon.h"
#include <OgreVector3.h>
#include <OgreSceneManager.h>
#include <OgreSceneNode.h>
#include "logger/logger.h"

#define NUMWEAPONS 6

#define STANDARD 0
#define SPREADER 1
#define FLAMER 2
#define LINER 3

class World;
class Weapon;

class Player: public AI
{
public:
    Player(World *world);
    Ogre::Vector3 getPosition(){
        return m_node->getPosition();
    }
    void moveLeft(float time);
    void moveRight(float time);
    void moveUp(float time);
    void moveDown(float time);
    void move(float time);
    virtual int getType(){return TYPE_PLAYER;}
    virtual bool colides();
    virtual void colide(AI *object);
    void fire();
    void setWeapon(int weapon);
    void weaponNext();
    void weaponPrevious();
    void setROF(int newROF);
    void animDeath(Ogre::Vector3 lastPos);
    int getHealth(){
        return m_health;
    }

    int setHealth(int health){
        m_health = health;
    }

    void shield(bool onOf);
    virtual void destroy();
    Weapon *m_weapon;

    Singleton *m_logger;

    bool m_deflecting;

protected:
    void adjustPosition(float time);
    Ogre::SceneManager *m_scene;
    Ogre::SceneNode *m_node;
    Ogre::SceneNode *m_shieldNode;

private:
    void bindToBox();

    Ogre::Vector3 shipVector;
    Ogre::Real boostCounter;
    Ogre::Real slideAmount;
    Ogre::Real normSpeed;
    Ogre::Real maxSpeed;
    Ogre::Real acceleration;
    Ogre::Real rollAmount;

    Ogre::Real worldEdgeLeft;
    Ogre::Real worldEdgeRight;
    Ogre::Real worldEdgeTop;
    Ogre::Real worldEdgeBottom;
    World *m_world;

    int tLastShot;
    int m_health;
    int m_currentWeapon;
};

#endif // PLAYER_H
